package arnaldoTestandoConeccao;



import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.AnnotationConfiguration;

public class HibernateFactory {
	private static SessionFactory factory;
	static {
	   AnnotationConfiguration cfg = new AnnotationConfiguration();

	   cfg.addAnnotatedClass(Produto.class);
	   factory = cfg.buildSessionFactory();
	}
	public Session getSession() {
	   return factory.openSession();
	}
}
